/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.menosehmais.model;

import br.com.menosehmais.framework.persistence.DomainObject;
import br.com.menosehmais.framework.persistence.IHaveCreationDateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.Type;
import org.joda.time.LocalDateTime;

/**
 *
 * @author Junior JAFJ
 */
@Entity(name="ganhador")
public class GanhadorDO extends DomainObject implements IHaveCreationDateTime {
    @Column(updatable = false)
    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    private LocalDateTime creationDateTime;
    
    @ManyToOne(fetch= FetchType.EAGER)
    private UsuarioDO usuario;

    public UsuarioDO getUsuario() {
        return usuario;
    }

    public void setUsuario(UsuarioDO usuario) {
        this.usuario = usuario;
    }
        
    @Override
    public LocalDateTime getCreationDateTime() {
        return creationDateTime;
    }

    @Override
    public void setCreationDateTime(LocalDateTime creationDateTime) {
        this.creationDateTime = creationDateTime;
    }
}
